package com.example.klinemqflink.service;


import com.example.klinemqflink.model.MarketData;
import com.example.klinemqflink.utils.Constant;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Service
public class SideOutputMarket implements CommandLineRunner {

    private boolean b = true;

    @Override
    public void run(String... args) throws Exception {
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (b){
                    try {
                        TimeUnit.SECONDS.sleep(5);
                        TypeInformation<MarketData> typeInfo = Constant.lateDataOutputTag.getTypeInfo();
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        }).start();
    }
}
